home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Disk User Volume 3 #6
/
Commodore_Disk_User_Vol.3_6_1990_-.d64
/
random div quiz
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
2KB
|
61 lines
1 rem 3d demo, (c)1989 m.h.westerweel
2 poke53280,14:poke53281,6:poke646,14
3 rem read 1st file from disk
4 rem =======================
5 dimd3$(43):open8,8,8,"0:3d-text file,s,r"
10 ford3=1to36:input#8,x$:input#8,y$:d3$(d3)=x$+y$:next
15 ford3=37to42:input#8,d3$(d3):next:close8
20 d3$(43)=chr$(13)+""
22 :
23 rem read 2nd file from disk
24 rem =======================
25 dimdd$(43):open8,8,8,"0:3d-text file 2,s,r"
30 fordd=1to36:input#8,x$:input#8,y$:dd$(dd)=x$+y$:next
35 fordd=37to42:input#8,dd$(dd):next:close8:dd$(43)=d3$(43)
37 :
38 rem initialize strings & rnd
39 rem ========================
40 up$="[145][145][145][145][145]":z$="[147][146]":tt=rnd(-ti)
47 :
48 rem read wrong, right & huh?!? data
49 rem ===============================
50 dima(16):fora=1to16:reada(a):next
52 :
53 rem read wow!!! (center screen) data
54 rem ================================
55 dimb(14):forb=1to14:readb(b):next
57 :
58 rem randomize division problems
59 rem ===========================
60 x=int(15*rnd(1))+1:y=int(15*rnd(1))+1:xy=x*y
70 printz$;xy;"/";y;"= ";
77 :
78 rem process user's response
79 rem =======================
80 inputi$:print:printchr$(29);:i=val(i$):ifi=xthen110
90 ifi<1ori>15then120
97 :
98 :rem print feedback to screen
99 :rem ========================
100 fora=1to5:printd3$(a(a))up$;:next:wr=wr+1:goto130
110 fora=6to10:printd3$(a(a))up$;:next:ri=ri+1:goto130
120 fora=11to16:printd3$(a(a))up$;:next:h=1
130 i$="":forw=1to1000:nextw:ifh=1thenh=0:goto70
140 ifwr+ri<10then60
150 printz$spc(10);ri;"out of 10 right":ifri<8then170
152 :
153 rem print wow!!! for 8+/10 right
154 rem ============================
155 forzz=1to10
160 print"";:forb=1to14:printd3$(b(b))up$;:next
165 print"";:forb=1to14:printdd$(b(b))up$;:next:next
167 :
168 rem reset for next 10 problems
169 rem ==========================
170 ri=0:wr=0:forw=1to2000:nextw:goto60
997 :
998 :rem data for printing 3d text
999 :rem =========================
1000 data 23,18,15,14,7,18,9,7,8,20,8,21,8,41,40,41
1005 data 43,42,42,42,42,42,42,42,23,15,23,40,40,40